package com.hehao.reactorPractice;

import com.hehao.entity.User;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * @Author Damon
 * @Date 2024/5/8 16:51
 */
public class ReactiveToBlockingPractice {
    // TODO Return the user contained in that Mono 返回 Mono 中包含的用户。
    User monoToValue(Mono<User> mono) {
        return mono.block();
    }

//========================================================================================

    // TODO Return the users contained in that Flux  返回 Flux 中包含的用户。
    Iterable<User> fluxToValues(Flux<User> flux) {
        return flux.toIterable();
    }
}
